//
//  GroupItemsTableViewCell.m
//  Findif
//
//  Created by Mac on 2019/2/22.
//  Copyright © 2019年 Cicel Chen. All rights reserved.
//

#import "GroupItemsTableViewCell.h"

@interface GroupItemsTableViewCell ()

@property (nonatomic, weak)UIView * backView;
@property (nonatomic, weak)UILabel * titleLabel;
@property (nonatomic, strong)UIButton * oneButton;
@property (nonatomic, strong)UIButton * twoButton;
@property (nonatomic, strong)UIButton * threeButton;
@property (nonatomic, strong)UIButton * fourButton;
@property (nonatomic, strong)UIButton * fiveButton;
@property (nonatomic, strong)UILabel * oneLabel;
@property (nonatomic, strong)UILabel * twoLabel;
@property (nonatomic, strong)UILabel * threeLabel;
@property (nonatomic, strong)UILabel * fourLabel;
@property (nonatomic, strong)UILabel * fiveLabel;
@property (nonatomic, weak)UIImageView * rightImageView;
@property (nonatomic, weak)UIView * lineView;


@end

@implementation GroupItemsTableViewCell


- (void)setMemberArray:(NSArray *)memberArray{
    
    _memberArray = memberArray;
    
    if (memberArray.count == 1) {
        
        self.oneButton.hidden = NO;
        self.oneLabel.hidden = NO;
        self.twoButton.hidden = NO;
        self.twoLabel.hidden = NO;
        self.threeButton.hidden = YES;
        self.threeLabel.hidden = YES;
        self.fourButton.hidden = YES;
        self.fourLabel.hidden = YES;
        self.fiveButton.hidden = YES;
        self.fiveLabel.hidden = YES;
        
        NSDictionary * dict = memberArray.firstObject;
        NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
        NSURL * iconUrl = [NSURL URLWithString:iconStr];
        [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
        self.oneLabel.text = dict[@"user_name"];
        self.oneLabel.textColor = [UIColor lightGrayColor];
        int user_id = [dict[@"user_id"] intValue];
        self.oneButton.tag = user_id;
        
        [self.twoButton setImage:[UIImage imageNamed:@"invite"] forState:UIControlStateNormal];
        self.twoLabel.text = @"邀请";
        self.twoLabel.textColor = ColorWithRGB(0xFFE035);
        self.twoButton.tag = 1;
    }else if (memberArray.count == 2){
        
        self.oneButton.hidden = NO;
        self.oneLabel.hidden = NO;
        self.twoButton.hidden = NO;
        self.twoLabel.hidden = NO;
        self.threeButton.hidden = NO;
        self.threeLabel.hidden = NO;
        self.fourButton.hidden = YES;
        self.fourLabel.hidden = YES;
        self.fiveButton.hidden = YES;
        self.fiveLabel.hidden = YES;
        
        NSDictionary * dict = memberArray.firstObject;
        NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
        NSURL * iconUrl = [NSURL URLWithString:iconStr];
        [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
        self.oneLabel.text = dict[@"user_name"];
        self.oneLabel.textColor = [UIColor lightGrayColor];
        int user_id = [dict[@"user_id"] intValue];
        self.oneButton.tag = user_id;
        
        NSDictionary * twoDict = memberArray.lastObject;
        NSString * twoIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,twoDict[@"head_img"]];
        NSURL * twoIconUrl = [NSURL URLWithString:twoIconStr];
        [self.twoButton sd_setImageWithURL:twoIconUrl forState:UIControlStateNormal];
        self.twoLabel.text = twoDict[@"user_name"];
        self.twoLabel.textColor = [UIColor lightGrayColor];
        int twoUser_id = [twoDict[@"user_id"] intValue];
        self.twoButton.tag = twoUser_id;
        
        [self.threeButton setImage:[UIImage imageNamed:@"invite"] forState:UIControlStateNormal];
        self.threeLabel.text = @"邀请";
        self.threeLabel.textColor = ColorWithRGB(0xFFE035);
        self.threeButton.tag = 1;
    }else if (memberArray.count == 3){
        
        self.oneButton.hidden = NO;
        self.oneLabel.hidden = NO;
        self.twoButton.hidden = NO;
        self.twoLabel.hidden = NO;
        self.threeButton.hidden = NO;
        self.threeLabel.hidden = NO;
        self.fourButton.hidden = NO;
        self.fourLabel.hidden = NO;
        self.fiveButton.hidden = YES;
        self.fiveLabel.hidden = YES;
        
        NSDictionary * dict = memberArray.firstObject;
        NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
        NSURL * iconUrl = [NSURL URLWithString:iconStr];
        [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
        self.oneLabel.text = dict[@"user_name"];
        self.oneLabel.textColor = [UIColor lightGrayColor];
        int user_id = [dict[@"user_id"] intValue];
        self.oneButton.tag = user_id;
        
        NSDictionary * twoDict = memberArray[1];
        NSString * twoIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,twoDict[@"head_img"]];
        NSURL * twoIconUrl = [NSURL URLWithString:twoIconStr];
        [self.twoButton sd_setImageWithURL:twoIconUrl forState:UIControlStateNormal];
        self.twoLabel.text = twoDict[@"user_name"];
        self.twoLabel.textColor = [UIColor lightGrayColor];
        int twoUser_id = [twoDict[@"user_id"] intValue];
        self.twoButton.tag = twoUser_id;
        
        NSDictionary * threeDict = memberArray[2];
        NSString * threeIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,threeDict[@"head_img"]];
        NSURL * threeIconUrl = [NSURL URLWithString:threeIconStr];
        [self.threeButton sd_setImageWithURL:threeIconUrl forState:UIControlStateNormal];
        self.threeLabel.text = threeDict[@"user_name"];
        self.threeLabel.textColor = [UIColor lightGrayColor];
        int threeUser_id = [threeDict[@"user_id"] intValue];
        self.threeButton.tag = threeUser_id;
        
        [self.fourButton setImage:[UIImage imageNamed:@"invite"] forState:UIControlStateNormal];
        self.fourLabel.text = @"邀请";
        self.fourLabel.textColor = ColorWithRGB(0xFFE035);
        self.fourButton.tag = 1;
    }else if (memberArray.count >= 3){
        
        self.oneButton.hidden = NO;
        self.oneLabel.hidden = NO;
        self.twoButton.hidden = NO;
        self.twoLabel.hidden = NO;
        self.threeButton.hidden = NO;
        self.threeLabel.hidden = NO;
        self.fourButton.hidden = NO;
        self.fourLabel.hidden = NO;
        self.fiveButton.hidden = NO;
        self.fiveLabel.hidden = NO;
        
        NSDictionary * dict = memberArray.firstObject;
        NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
        NSURL * iconUrl = [NSURL URLWithString:iconStr];
        [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
        self.oneLabel.text = dict[@"user_name"];
        self.oneLabel.textColor = [UIColor lightGrayColor];
        int user_id = [dict[@"user_id"] intValue];
        self.oneButton.tag = user_id;
        
        NSDictionary * twoDict = memberArray[1];
        NSString * twoIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,twoDict[@"head_img"]];
        NSURL * twoIconUrl = [NSURL URLWithString:twoIconStr];
        [self.twoButton sd_setImageWithURL:twoIconUrl forState:UIControlStateNormal];
        self.twoLabel.text = twoDict[@"user_name"];
        self.twoLabel.textColor = [UIColor lightGrayColor];
        int twoUser_id = [twoDict[@"user_id"] intValue];
        self.twoButton.tag = twoUser_id;
        
        NSDictionary * threeDict = memberArray[2];
        NSString * threeIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,threeDict[@"head_img"]];
        NSURL * threeIconUrl = [NSURL URLWithString:threeIconStr];
        [self.threeButton sd_setImageWithURL:threeIconUrl forState:UIControlStateNormal];
        self.threeLabel.text = threeDict[@"user_name"];
        self.threeLabel.textColor = [UIColor lightGrayColor];
        int threeUser_id = [threeDict[@"user_id"] intValue];
        self.threeButton.tag = threeUser_id;
        
        NSDictionary * fourDict = memberArray[3];
        NSString * fourIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,fourDict[@"head_img"]];
        NSURL * fourIconUrl = [NSURL URLWithString:fourIconStr];
        [self.fourButton sd_setImageWithURL:fourIconUrl forState:UIControlStateNormal];
        self.fourLabel.text = fourDict[@"user_name"];
        self.fourLabel.textColor = [UIColor lightGrayColor];
        int fourUser_id = [fourDict[@"user_id"] intValue];
        self.fourButton.tag = fourUser_id;
        
        [self.fiveButton setImage:[UIImage imageNamed:@"invite"] forState:UIControlStateNormal];
        self.fiveLabel.text = @"邀请";
        self.fiveLabel.textColor = ColorWithRGB(0xFFE035);
        self.fiveButton.tag = 1;
    }
}


- (void)setType:(NSString *)type{
    
    _type = type;
    
    if ([type isEqualToString:@"2"]) {
        
        if (self.memberArray.count == 1) {
            
            self.oneButton.hidden = NO;
            self.oneLabel.hidden = NO;
            self.twoButton.hidden = YES;
            self.twoLabel.hidden = YES;
            self.threeButton.hidden = YES;
            self.threeLabel.hidden = YES;
            self.fourButton.hidden = YES;
            self.fourLabel.hidden = YES;
            self.fiveButton.hidden = YES;
            self.fiveLabel.hidden = YES;
            
            NSDictionary * dict = self.memberArray.firstObject;
            NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
            NSURL * iconUrl = [NSURL URLWithString:iconStr];
            [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
            self.oneLabel.text = dict[@"user_name"];
            self.oneLabel.textColor = [UIColor lightGrayColor];
            int user_id = [dict[@"user_id"] intValue];
            self.oneButton.tag = user_id;
        }else if (self.memberArray.count == 2){
            
            self.oneButton.hidden = NO;
            self.oneLabel.hidden = NO;
            self.twoButton.hidden = NO;
            self.twoLabel.hidden = NO;
            self.threeButton.hidden = YES;
            self.threeLabel.hidden = YES;
            self.fourButton.hidden = YES;
            self.fourLabel.hidden = YES;
            self.fiveButton.hidden = YES;
            self.fiveLabel.hidden = YES;
            
            NSDictionary * dict = self.memberArray.firstObject;
            NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
            NSURL * iconUrl = [NSURL URLWithString:iconStr];
            [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
            self.oneLabel.text = dict[@"user_name"];
            self.oneLabel.textColor = [UIColor lightGrayColor];
            int user_id = [dict[@"user_id"] intValue];
            self.oneButton.tag = user_id;
            
            NSDictionary * twoDict = self.memberArray.lastObject;
            NSString * twoIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,twoDict[@"head_img"]];
            NSURL * twoIconUrl = [NSURL URLWithString:twoIconStr];
            [self.twoButton sd_setImageWithURL:twoIconUrl forState:UIControlStateNormal];
            self.twoLabel.text = twoDict[@"user_name"];
            self.twoLabel.textColor = [UIColor lightGrayColor];
            int twoUser_id = [twoDict[@"user_id"] intValue];
            self.twoButton.tag = twoUser_id;
        }else if (self.memberArray.count == 3){
            
            self.oneButton.hidden = NO;
            self.oneLabel.hidden = NO;
            self.twoButton.hidden = NO;
            self.twoLabel.hidden = NO;
            self.threeButton.hidden = NO;
            self.threeLabel.hidden = NO;
            self.fourButton.hidden = YES;
            self.fourLabel.hidden = YES;
            self.fiveButton.hidden = YES;
            self.fiveLabel.hidden = YES;
            
            NSDictionary * dict = self.memberArray.firstObject;
            NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
            NSURL * iconUrl = [NSURL URLWithString:iconStr];
            [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
            self.oneLabel.text = dict[@"user_name"];
            self.oneLabel.textColor = [UIColor lightGrayColor];
            int user_id = [dict[@"user_id"] intValue];
            self.oneButton.tag = user_id;
            
            NSDictionary * twoDict = self.memberArray[1];
            NSString * twoIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,twoDict[@"head_img"]];
            NSURL * twoIconUrl = [NSURL URLWithString:twoIconStr];
            [self.twoButton sd_setImageWithURL:twoIconUrl forState:UIControlStateNormal];
            self.twoLabel.text = twoDict[@"user_name"];
            self.twoLabel.textColor = [UIColor lightGrayColor];
            int twoUser_id = [twoDict[@"user_id"] intValue];
            self.twoButton.tag = twoUser_id;
            
            NSDictionary * threeDict = self.memberArray[2];
            NSString * threeIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,threeDict[@"head_img"]];
            NSURL * threeIconUrl = [NSURL URLWithString:threeIconStr];
            [self.threeButton sd_setImageWithURL:threeIconUrl forState:UIControlStateNormal];
            self.threeLabel.text = threeDict[@"user_name"];
            self.threeLabel.textColor = [UIColor lightGrayColor];
            int threeUser_id = [threeDict[@"user_id"] intValue];
            self.threeButton.tag = threeUser_id;
        }else if (self.memberArray.count >= 3){
            
            self.oneButton.hidden = NO;
            self.oneLabel.hidden = NO;
            self.twoButton.hidden = NO;
            self.twoLabel.hidden = NO;
            self.threeButton.hidden = NO;
            self.threeLabel.hidden = NO;
            self.fourButton.hidden = NO;
            self.fourLabel.hidden = NO;
            self.fiveButton.hidden = YES;
            self.fiveLabel.hidden = YES;
            
            NSDictionary * dict = self.memberArray.firstObject;
            NSString * iconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,dict[@"head_img"]];
            NSURL * iconUrl = [NSURL URLWithString:iconStr];
            [self.oneButton sd_setImageWithURL:iconUrl forState:UIControlStateNormal];
            self.oneLabel.text = dict[@"user_name"];
            self.oneLabel.textColor = [UIColor lightGrayColor];
            int user_id = [dict[@"user_id"] intValue];
            self.oneButton.tag = user_id;
            
            NSDictionary * twoDict = self.memberArray[1];
            NSString * twoIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,twoDict[@"head_img"]];
            NSURL * twoIconUrl = [NSURL URLWithString:twoIconStr];
            [self.twoButton sd_setImageWithURL:twoIconUrl forState:UIControlStateNormal];
            self.twoLabel.text = twoDict[@"user_name"];
            self.twoLabel.textColor = [UIColor lightGrayColor];
            int twoUser_id = [twoDict[@"user_id"] intValue];
            self.twoButton.tag = twoUser_id;
            
            NSDictionary * threeDict = self.memberArray[2];
            NSString * threeIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,threeDict[@"head_img"]];
            NSURL * threeIconUrl = [NSURL URLWithString:threeIconStr];
            [self.threeButton sd_setImageWithURL:threeIconUrl forState:UIControlStateNormal];
            self.threeLabel.text = threeDict[@"user_name"];
            self.threeLabel.textColor = [UIColor lightGrayColor];
            int threeUser_id = [threeDict[@"user_id"] intValue];
            self.threeButton.tag = threeUser_id;
            
            NSDictionary * fourDict = self.memberArray[3];
            NSString * fourIconStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,fourDict[@"head_img"]];
            NSURL * fourIconUrl = [NSURL URLWithString:fourIconStr];
            [self.fourButton sd_setImageWithURL:fourIconUrl forState:UIControlStateNormal];
            self.fourLabel.text = fourDict[@"user_name"];
            self.fourLabel.textColor = [UIColor lightGrayColor];
            int fourUser_id = [fourDict[@"user_id"] intValue];
            self.fourButton.tag = fourUser_id;
        }
    }
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI{
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.backgroundColor = ColorWithRGB(0xF4F5F6);
    
    UIView * backView = [UIView new];
    
    backView.backgroundColor  =ZRWhiteColor;
    backView.layer.cornerRadius = 5 * SCREENH6;
    backView.layer.masksToBounds = YES;
    backView.userInteractionEnabled = YES;
    
    self.backView = backView;
    
    [self.contentView addSubview:self.backView];
    
    UILabel * titleLabel = [[UILabel alloc] init];
    
    titleLabel.text = @"社团成员";
    titleLabel.textColor = ZRBlackColor;
    titleLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.titleLabel = titleLabel;
    
    [self.backView addSubview:self.titleLabel];
    
    UIImageView * rightImageView = [[UIImageView alloc] init];
    
    rightImageView.image = [UIImage imageNamed:@"右箭头"];
    
    self.rightImageView = rightImageView;
    
    [self.backView addSubview:self.rightImageView];
    
    UILabel * countLabel = [UILabel new];
    
    countLabel.text = @"----";
    countLabel.textColor = [UIColor lightGrayColor];
    countLabel.textAlignment = NSTextAlignmentRight;
    countLabel.font = [UIFont systemFontOfSize:13 * SCREENH6];
    
    self.countLabel = countLabel;
    
    [self.backView addSubview:self.countLabel];
    
    self.oneButton = [self setupIconButtonWith:@"组12"];
    [self.backView addSubview:self.oneButton];
    self.twoButton = [self setupIconButtonWith:@"组12"];
    [self.backView addSubview:self.twoButton];
    self.threeButton = [self setupIconButtonWith:@"组12"];
    [self.backView addSubview:self.threeButton];
    self.fourButton = [self setupIconButtonWith:@"组12"];
    [self.backView addSubview:self.fourButton];
    self.fiveButton = [self setupIconButtonWith:@"invite"];
    [self.backView addSubview:self.fiveButton];
    
    self.oneLabel = [self setupLabelWith:@"昔年"];
    [self.backView addSubview:self.oneLabel];
    self.twoLabel = [self setupLabelWith:@"昔年"];
    [self.backView addSubview:self.twoLabel];
    self.threeLabel = [self setupLabelWith:@"昔年"];
    [self.backView addSubview:self.threeLabel];
    self.fourLabel = [self setupLabelWith:@"昔年"];
    [self.backView addSubview:self.fourLabel];
    self.fiveLabel = [self setupLabelWith:@"邀请"];
    self.fiveLabel.textColor = ColorWithRGB(0xFFE035);
    [self.backView addSubview:self.fiveLabel];
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = ColorWithRGB(0xe4e4e4);
    
    self.lineView = lineView;
    
    [self.backView addSubview:self.lineView];
}


- (void)layoutSubviews{
    
    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView);
        make.top.mas_equalTo(self.contentView).offset(10 * SCREENH6);
        make.width.mas_equalTo(345 * SCREENH6);
        make.height.mas_equalTo(120 * SCREENH6);
    }];

    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.backView).offset(8 * SCREENH6);
        make.leading.mas_equalTo(self.backView).offset(10 * SCREENH6);
    }];
    
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.titleLabel);
        make.trailing.mas_equalTo(self.backView).offset(-10 * SCREENH6);
        make.width.mas_equalTo(7 * SCREENH6);
        make.height.mas_equalTo(12.5 * SCREENH6);
    }];
    
    [self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.rightImageView);
        make.trailing.mas_equalTo(self.rightImageView.mas_leading).offset(-10 * SCREENH6);
    }];
    
    [self.oneButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.width.mas_equalTo(50 * SCREENH6);
        make.leading.mas_equalTo(self.backView).offset(10 * SCREENH6);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(8 * SCREENH6);
    }];

    [self.oneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.oneButton);
        make.width.mas_equalTo(self.oneButton);
        make.top.mas_equalTo(self.oneButton.mas_bottom).offset(8 * SCREENH6);
    }];

    [self.twoButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.width.height.mas_equalTo(self.oneButton);
        make.leading.mas_equalTo(self.oneButton.mas_trailing).offset(18 * SCREENH6);
    }];
    
    [self.twoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.width.mas_equalTo(self.twoButton);
        make.top.mas_equalTo(self.twoButton.mas_bottom).offset(8 * SCREENH6);
    }];
    
    [self.threeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.width.height.mas_equalTo(self.twoButton);
        make.leading.mas_equalTo(self.twoButton.mas_trailing).offset(18 * SCREENH6);
    }];
    
    [self.threeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.width.mas_equalTo(self.threeButton);
        make.top.mas_equalTo(self.threeButton.mas_bottom).offset(8 * SCREENH6);
    }];
    
    [self.fourButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.width.height.mas_equalTo(self.threeButton);
        make.leading.mas_equalTo(self.threeButton.mas_trailing).offset(18 * SCREENH6);
    }];
    
    [self.fourLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.width.mas_equalTo(self.fourButton);
        make.top.mas_equalTo(self.fourButton.mas_bottom).offset(8 * SCREENH6);
    }];
    
    [self.fiveButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.width.height.mas_equalTo(self.fourButton);
        make.leading.mas_equalTo(self.fourButton.mas_trailing).offset(18 * SCREENH6);
    }];
    
    [self.fiveLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.width.mas_equalTo(self.fiveButton);
        make.top.mas_equalTo(self.fiveButton.mas_bottom).offset(8 * SCREENH6);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.oneButton);
        make.trailing.mas_equalTo(self.contentView).offset(-10 * SCREENH6);
        make.bottom.mas_equalTo(self.backView);
        make.height.mas_equalTo(1 * SCREENH6);
    }];
}


- (UIButton *)setupIconButtonWith:(NSString *)img{
    
    UIButton * button = [UIButton new];
    
    [button setImage:[UIImage imageNamed:img] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(clickIconButton:) forControlEvents:UIControlEventTouchUpInside];
    button.layer.cornerRadius = 25 * SCREENH6;
    button.layer.masksToBounds = YES;
    
    return button;
}

- (UILabel *)setupLabelWith:(NSString *)string{
    
    UILabel * label = [UILabel new];
    
    label.text = string;
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:14 * SCREENH6];
    label.textColor = [UIColor lightGrayColor];
    
    return label;
}

- (void)clickIconButton:(UIButton *)button{
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(clickMembersButtonWithTag:)])
    {
        NSString * tag = [NSString stringWithFormat:@"%ld",button.tag];
        
        NSLog(@"tag===%@",tag);
        [self.delegate clickMembersButtonWithTag:tag];
    }
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
